<?php

class Workset_Filter_ValueIndex implements Zend_Filter_Interface {

	function filter($value) {
        if (is_array($value)) {
            $value = array_map(array($this, '_filter'), $value);
        } else {
            $value = $this->_filter($value);
        }
        return $value;
	}

    function _filter($value) {
        if (isNumeric($value)) {
            return (int)$value;
        } else {
            $value = crc32((string)$value);
			return $value >= 0 ? $value : ($value * -1);
		}
    }

}

?>